package com.dianziq.im.server.cmd;

import java.nio.charset.Charset;
import java.util.Map;

public abstract  class Action {

	static Charset UTF8 = Charset.forName("UTF-8");
	static Map<String,Action> cmds=new java.util.HashMap<String, Action>();

	 
	static {
		
		cmds.put("/cmd", new Cmd());
		cmds.put("/pull", new Pull());
		cmds.put("/msg", new Msg());
		cmds.put("/list", new List());
		
		
	}
	
	protected Action(){
		
	}
	public static Action from(String path){
	 
		return cmds.get(path);
	}
	
	public abstract void handle(Context c);
	 
}
